<?php
class Utils {
	
	private static $instance = null;
	
	public function __construct() {
		if (self::$instance != null) return;
		self::$instance = $this;
	}
	
	public static function random_string($length) {
		$random= '';
		srand((double)microtime()*1000000);
		$char_list = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
			.'abcdefghijklmnopqrstuvwxyz'
			.'1234567890';
		
		for($i = 0; $i < $length; $i++) {
			$random .= substr($char_list,(rand()%(strlen($char_list))), 1);
		}
		
		return $random;
	}
}